import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lyn
 * Date: 2025-01-14
 * Time: 11:04
 */
public class text {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9};
        System.out.println(Arrays.binarySearch(arr, 3));

    }

    public static void main3(String[] args) {
        int[] arr= {1,2,3,4,5};
        int[] copy = Arrays.copyOf(arr,arr.length);
        System.out.println(Arrays.toString(copy));
        int[] copy2 = Arrays.copyOfRange(arr,1,3);
        System.out.println(Arrays.toString(copy2));

    }
    public static String myToString(int[] array){
        String ret = "[";
        for (int i = 0; i < array.length; i++) {
          ret += array[i];
          if(i != array.length - 1)
              ret += ",";
        }
        ret += "]";
        return ret;
    }

    public static void main2(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6};
        System.out.println(myToString(arr));
    }
    public static void main1(String[] args) {
        int[] arr = {1,2,3,4,5};
        String s = Arrays.toString(arr);
        System.out.println(Arrays.toString(arr));

    }
}
